package com.heboan.code3;

/*
    通话套餐
*/
public class CallPackage extends PackageAbstract implements CallInterface {
    // 通话时长
    private int duration;
    // 短信条数
    private int msgNum;

    public CallPackage() {
    }

    public CallPackage(int duration, int msgNum, double charge) {
        super(charge);
        this.duration = duration;
        this.msgNum = msgNum;
    }

    public int getDuration() {
        return duration;
    }

    public int getMsgNum() {
        return msgNum;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public void setMsgNum(int msgNum) {
        this.msgNum = msgNum;
    }


    // 显示所有套餐信息
    @Override
    public void show(){
        System.out.println("通话套餐[通话时长：" + getDuration() + ",短信条数:" + getMsgNum() + "每月资费：" + getCharge() +"]" );
    }


    @Override
    public void call(int duration, SimCard simCard){
        System.out.println(simCard.getId() + "通话了" + duration + "分钟");
    }
}
